<template>
  <div>
    <el-table border :data="tableData" style="width: 100%">
      <el-table-column type="expand">
        <template slot-scope="props">
          <el-table border :data="props.row.children" style="width: 100%">
            <el-table-column label="所属院id" prop="fatherId"></el-table-column>
            <el-table-column label="实验室编号" prop="num"></el-table-column>
            <el-table-column label="名称" prop="name"></el-table-column>
            <el-table-column label="描述" prop="desc"></el-table-column>
            <el-table-column label="详情" prop="address"></el-table-column>
            <test2/>
          </el-table>
        </template>
      </el-table-column>
      <el-table-column label="院id" prop="id"></el-table-column>
      <el-table-column label="名称" prop="name"></el-table-column>
      <el-table-column label="地址" prop="desc"></el-table-column>
      <test2/>
    </el-table>
    <test2/>
  </div>
</template>



<script>
import test2 from './test2'
export default {
    components:{
        test2
    },
  data() {
    return {
      tableData: [
        {
          id: 1,
          name: "大数据学院",
          address: "上海市普陀区真北路",
          children: [
            {
              fatherId: 1,
              num: "1-1",
              name: "实验室1",
              desc: "实验室1",
              address: "实验室1"
            },
            {
              fatherId: 1,
              num: "1-2",
              name: "实验室12",
              desc: "实验室12",
              address: "实验室12"
            }
          ]
        },
        {
          id: 2,
          name: "大数据学院2",
          address: "上海市普陀区真北路",
          children: [
            {
              fatherId: 2,
              name: "实验室2",
              desc: "实验室2",
              address: "实验室2"
            }
          ]
        },
        {
          id: 3,
          name: "大数据学院3",
          address: "上海市普陀区真北路"
        },
        {
          id: 4,
          name: "大数据学院4",
          address: "上海市普陀区真北路"
        }
      ]
    };
  },
  mounted: {},
  methods: {
  }
  
};
</script>

<style scoped>
</style>

